import request from '@/utils/request'

/**
 * 获取部门列表
 */
export const deptList = () => {
  return request({
    url: '/sys/dept/tree'
  })
}

export const deptAdd = data => {
  return request({
    url: '/sys/dept/save',
    method: 'POST',
    data
  })
}

export const deptUpdate = data => {
  return request({
    url: '/sys/dept/update',
    method: 'POST',
    data
  })
}

export const deptDelete = id => {
  return request({
    url: `/sys/dept/delete/${id}`,
    method: 'delete'
  })
}
